package com.ty.xiaoyu.service;

import com.ty.xiaoyu.entity.BrowsingHistory;
import com.ty.xiaoyu.entity.Module;
import com.ty.xiaoyu.exception.BrowsingHistoryOperationException;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface BrowsingHistoryService {

    // 根据用户id获取浏览记录列表
    List<BrowsingHistory> getListByUserId(String userId) throws BrowsingHistoryOperationException;

    // 新增记录（看贴、看模块的详情页）
    void addHistory(BrowsingHistory history) throws BrowsingHistoryOperationException;

    // 更新记录
    void modifyHistory(BrowsingHistory history) throws BrowsingHistoryOperationException;

    // 根据用户id、模块id、帖子id获取记录id
    BrowsingHistory getHistoryId(String userId, String moduleId, String topicId);

    // 根据用户id获取浏览的模块记录
    List<Module> getHistoryListOfModuleByUserId(String userId) throws BrowsingHistoryOperationException;

    // 根据记录id删除浏览记录
    void deleteHistoryById(@Param("historyId") String historyId) throws BrowsingHistoryOperationException;
}
